﻿using LY.Entity;
using LY.Entity.Entities;
using LY.Entity.PageSearch;
using LY.Entity.SearchEntity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace LY.Interface
{
    public interface IMemberService
    {
        //系统消息
        PagedList<U_Information_EX> QuerySystemInformation(InformationSearch search, PageView view);

        List<Member_EX> GetMemberByName(string membername);

        int CardVerification(string name, int? IDType, string IDCode, int? id);
        /// <summary>
        /// 根据条件获得检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<Member_EX> QueryMemberList(MemberSearch search, PageView view);
        /// <summary>
        /// 根据条件获得检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="userid">客户ID</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<Member_EX> QueryMemberListByUser(MemberSearch search, int userid, PageView view);

        /// <summary>
        /// 根据条件获得检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="userid">客户ID</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<Member_EX> QueryMemberListByDept(MemberSearch search, int deptid, PageView view);

        /// <summary>
        /// 根据条件获得待分配会员检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<U_Member> QueryAssignMemberList(MemberSearch search, int deptid, PageView view);

        /// <summary>
        /// 根据条件获得部门待分配会员检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<U_Member> QueryDeptAssignMemberList(MemberSearch search, PageView view);

        /// <summary>
        /// 根据条件获得待分配会员检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<U_Member> QueryAssignDeptMemberList(MemberSearch search, PageView view);

        /// <summary>
        /// 编辑、添加 会员信息
        /// </summary>
        /// <param name="member"></param>
        /// <returns></returns>
        int SaveMember(U_Member member);

        int SelAccountID(int? id);
        /// <summary>
        /// 删除会员信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int DeleteMember(int id);



        //分配到部门
        int AssignDept(string mids, string did);
        //分配到部门
        int AssignUser(string mids, string uid);

        /// <summary>
        /// 分配客服
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int AssignMember(string ids, string mid);

        int AccountVerification(string AccountName, int? id);
        int Account_BankVerification(int accountid, string Bank, string Branch, string BankCardNo, string RealNameOfBank);
        int Account_BankVerif(U_BankCard bank);
        int BankValidate(int? id);
        int PayValidate(int? id);
        //表单提交  绑定银行卡，设置提现密码
        int SaveAuthBanks(U_BankCard bank, string payPassword, int? memberid);
        int SaveAuthBank(U_BankCard bank, string payPassword);

        int MailVerification(string m, int? id);
        /// <summary>
        /// 根据编号获得member对象
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Member_EX GetMember(int? id);

        //验证激活邮箱
        int UpdEmailValidate(string membername, string email);
        /// <summary>
        /// 设置安全问题
        /// </summary>
        /// <param name="membername"></param>
        /// <param name="question"></param>
        /// <param name="anser"></param>
        /// <returns></returns>

        //保存密保问题
        int SetQuestionOne(int id, string question, string anser);
        int SetQuestionTwo(int id, string question, string anser);
        int SetQuestionThree(int id, string question, string anser);

        //验证支付密码
        int ValidatePayPass(string memberName, string accountName, string payPwd);
        //修改登录密码
        int UpdateLoginpwd(int? id, string password);

        //修改支付密码
        int UpdatePaypwd(int? id, string password);

        //验证手机号
        int ValidatePhone(U_Member member);

        /// <summary>
        /// 根据条件获得检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<U_Member> GetMyMemberList(MemberSearch search, PageView view);

        /// <summary>
        /// 根据条件获得检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<U_Member> GetMyMemberFriendList(MemberSearch search, PageView view);

        /// <summary>
        /// 根据条件获得检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<U_Member> GetMyMemberFriendAddList(MemberSearch search, PageView view);

        /// <summary>
        /// 根据条件获得检索结果
        /// </summary>
        /// <param name="search">条件</param>
        /// <param name="view">search</param>
        /// <returns>返回member集合</returns>
        PagedList<U_Member> GetMyMemberFriendAcceptList(MemberSearch search, PageView view);
        ///// <summary>
        ///// 根据条件获得检索结果
        ///// </summary>
        ///// <param name="search">条件</param>
        ///// <param name="view">search</param>
        ///// <returns>返回member集合</returns>
        //PagedList<U_Member> MyMemberFriendAccept(MemberSearch search, PageView view);

        /// <summary>
        /// 添加好友
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int InsertMemberFriend(int applyfriendmemberid, int acceptfriendmemberid);

        /// <summary>
        /// 添加好友
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int AcceptMemberFriend(int applyfriendmemberid, int acceptfriendmemberid);
        /// <summary>
        /// @我的会员，下拉显示我的会员列表Name
        /// </summary>
        /// <param name="membername"></param>
        /// <param name="mkey"></param>
        /// <returns></returns>
        List<U_Member> GetMyMemeber(MemberSearch search);
        /// <summary>
        /// @我的会员，下拉显示我的好友列表Name
        /// </summary>
        /// <param name="membername"></param>
        /// <param name="mkey"></param>
        /// <returns></returns>
        List<U_MemberFriend_EX> GetMyFriends(MemberSearch search);
        /// <summary>
        /// 获得所有我的好友的MemberId
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        List<U_Member> GetMemberFriendsId(MemberSearch search);
        /// <summary>
        /// 获得所有我的会员的MemeberId
        /// </summary>
        /// <param name="mkey"></param>
        /// <returns></returns>
        List<U_Member> GetMyMemeberId(string mkey);
        /// <summary>
        /// 获得所有MemeberId
        /// </summary>
        /// <param name="memberid"></param>
        /// <param name="mkey"></param>
        /// <returns></returns>
        List<U_Member> GetAllId(string memberid, string mkey);
        /// <summary>
        /// 检索所有会员（用户）ID
        /// </summary>
        /// <returns></returns>
        List<U_Member> GetID();
        /// <summary>
        /// 获得我的会员、我的好友并集
        /// </summary>
        /// <param name="search"></param>
        /// <returns></returns>
        List<U_Member> GetAllMemberandFriend(MemberSearch search);
        //留言审核
        int MessageAudit(int id, string audituser, int status, string datetime, string auditremark);
        //个人积分
        int GetMemberScore(int? id);

        //查询今天注册的上一个会员编号
        Member_EX SelectLastMemberToday(string date);

        //查询出会员统计表的所有数据
        PagedList<U_MemberStatistics_EX> QueryMemberStatisticsList(MemberStatisticsSearch search, PageView view);

        //查询身份证，手机号码，邮箱是否重复
        string ValidateAll(string idCode, string mobilePhone, string email, int id);

        //由于没找到代码，所以先写一个简单的登陆
        U_Member login(string userName, string userPwd);

        //查询用户名是否存在
        string CheckUserName(string userName);


        //查询该会员是否已经绑定了这张银行卡
        string CheckBankCardDangDing(int memberId, string cardNo);


        //修改会员状态
        // int updateMemberStatus(int? id, int status);
        U_Member getMemberInfo(int? id);
        //根据邮箱地址查询
        U_Member getMemberStatus(string email);

        #region 我的收货地址
        /// <summary>
        /// 地址列表
        /// </summary>
        /// <param name="MemberId">会员ID</param>
        /// <returns></returns>
        List<U_UserAddress> GetAllUserAddress(int MemberId);

        PagedList<U_UserAddress> GetUserAddressList(UserAddressSearch search, PageView view);
        /// <summary>
        /// 保存地址
        /// </summary>
        /// <param name="model">地址实体</param>
        /// <returns></returns>
        int SaveUserAddress(U_UserAddress model);
        /// <summary>
        /// 删除地址
        /// </summary>
        /// <param name="Id">主键ID</param>
        /// <returns></returns>
        int DeleteUserAddress(int Id);


        //修改当前会员所有的地址为非默认
        int UpdateDefaultAddress(int? memberid);

        /// <summary>
        /// 设置默认收货地址
        /// </summary>
        /// <param name="Id">主键ID</param>
        /// <returns></returns>
        int SetDefaultAddress(int Id);


        U_UserAddress GetAddress(int id);


        #endregion


        //验证手机
        bool ExistsPhone(string phpone);

        /// <summary>
        /// 根据用户名查询实体对象
        /// </summary>
        /// <param name="Name"></param>
        /// <returns></returns>
        U_Member GetModelByName(string Name);

        /// <summary>
        /// 根据盛付通账号名查询实体，盛付通账号在本程序中是唯一的。
        /// </summary>
        /// <param name="sftUserName"></param>
        /// <returns></returns>
        U_Member GetModelBySftUserName(string sftUserName);


        //根据用户名、邮箱、手机号、查询用户信息（忘记密码）
        U_Member ForgetPwd(string info);

        //根据公司ID查询项目发起人信息
        U_CompanyAnnex_EX GetMemberInfo(int? cid);

        //(确定会员名唯一)
        U_Member GetMemberInfoByName(string name);


        #region 第三方注册
         int SaveMemberOauth(U_Member_oauth menOauth); 
        U_Member_oauth OauthLogin(string oauth_name,string oauth_openid);
        #endregion
    }

}
